<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台首页</title>
    <link href="../css/admin-index.css" rel="stylesheet" type="text/css"/>
</head>
<body>
    <div class="top-div"  width="100%" name="top" frameborder="0">
        <nav style="width: 200px;margin-top:5px;margin-left: 30px;">
            <label style="line-height: 50px;font-size: 16px;">VIP登记系统管理后台</label>
        </nav>
        <nav  class="top-nav">
            <ul style="list-style-type: none;line-height: 50px;">
                <li style="float:left;margin-left: 5px;">当前用户：</li>
                <li style="float:left;margin-left: 5px;" id="nowUser"></li>
                <li style="float:left;margin-left: 30px;" ><a href="#" onclick="login_out()">退出</a></li>
            </ul>
        </nav>
    </div>
    <iframe src="admin-left.html" width="15%" name="left" height=800px frameborder="1" scrolling="no"></iframe>
    <iframe src="personalInfo.html" id="right" width="84.2%" name="right" height="800px" frameborder="1" scrolling="no"></iframe>

    <script type="text/javascript" src="../lib/jquery.min.js"></script>
    <script type="text/javascript" src="../lib/H-ui.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            var realName = $.cookie('realnameCookie');
            $.cookie('groupidCookie');
            $("#nowUser").append(realName);


        });

        //退出
        function login_out() {
            $.ajax({
                type: "post",
                url: "/user/logout",
                data: {},
                dataType: "json",
                success: function (data) {
                    var status = data.status;
                    var msg = data.msg;
                    if (status == 0) {
                        $.cookie('identityCookie', '', {expires: -1}); // 删除 cookie
                        $.cookie('realnameCookie', '', {expires: -1});
                        $.cookie('groupidCookie', '', {expires: -1});
                        //document.location.reload();
                        $(location).attr('href', '../index.html');
                    } else {
                        alert(msg);
                    }

                },
                fail: function (data) {
                    alert(JSON.stringify(data));
                },
                error: function (xhr) {
                    alert('error:' + JSON.stringify(xhr));
                }
            });


        }

    </script>
</body>
</html>